package com.lxf.Novel;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;


/**
 * 小说框架
 */
public class Novel extends JFrame{
	
	 private JScrollPane sp_center;//总滚动面板
	
	 
	 private JPanel pl_ALL;//总面板
	
	 /*
	 * 上部固定面板
	 */
	private JPanel pl_north;//上部固定面板
	
	private JPanel pl_north_north;//上部固定面板上部
	private JLabel lb_BookSeaGirlNet;//书海女生网按钮
	private JLabel lb_BookSeaGirlNetPart;//书海女生网按钮隔开线
	private JLabel lb_BookSeaLiteratureNet;//书海文学网按钮
	private JLabel lb_BookSeaLiteratureNetPart;//书海文学网按钮隔开线
	private JLabel lb_BookSeaComicNet;//书海动漫网按钮
    private JLabel lb_register;//注册按钮
    private JLabel lb_registerPart;//注册按钮隔开线
	private JLabel lb_help;//帮助按钮
	private JLabel lb_helpPart;//帮助按钮隔开线
    private JLabel lb_north_login;//登录按钮
    private JLabel lb_north_loginPart;//登录按钮隔开线
    private JLabel lb_Client;//客户端按钮
	
	private JPanel pl_north_center;//上部固定面板中部
	private JLabel lb_BooksSea;//书海标签
	private JLabel lb_HotSearch;//热搜标签
	private JTextField tf_Search;//搜索文本域
	private JLabel lb_Search;//搜索按钮
	private JLabel lb_SearchTips;//搜索提示
	private JLabel lb_Recharge;//充值按钮
	private JLabel lb_WritersCenter;//作家中心按钮
	private JLabel lb_center_loginMail;//中部登录邮件图像
	private JLabel lb_center_loginHeadPicture;//中部登录头像
	
	
	private JPanel pl_north_south;//上部固定面板下部
    private JLabel lb_FirstPage;//首页按钮
    private JLabel lb_FirstPagePart;//首页按钮隔开线
    private JLabel lb_StackRoom;//书库按钮
    private JLabel lb_StackRoomPart;//书库按钮隔开线
    private JLabel lb_Ranking;//排行按钮
    private JLabel lb_RankingPart;//排行按钮隔开线
    private JLabel lb_IpSpecialArea;//IP专区按钮
    private JLabel lb_IpSpecialAreaPart;//IP专区按钮隔开线
    private JLabel lb_WriterWelfare;//作家福利按钮
    private JLabel lb_WriterWelfarePart;//作家福利按钮隔开线
    private JLabel lb_AnnounceInformation;//公告资讯按钮
    private JLabel lb_AnnounceInformationPart;//公告资讯按钮隔开线
    private JLabel lb_GirlSpecialArea;//女生专区按钮
    private JLabel lb_GirlSpecialAreaPart;//女生专区按钮隔开线
    private JLabel lb_MyBookShelf;//我的书架按钮
    
    /*
	 * 中部面板以及中部切换面板：首页、排行、登录、我的书库、注册
	 */
    private static int panelcount=0;//切换面板，记录是哪个面板,0表示首页
    private JPanel pl_center;//中部总面板
    private JPanel pl_centerleft;//中部切换面板左面板
    private JPanel pl_centerright;//中部切换面板右面板
    /*
     * 首页面板
     */
    private JPanel pl_FirstPage;//首页面板
    private JPanel pl_FirstPage_north;//首页面板上部层级面板
    private JLayeredPane ldp_FirstPage_north_left;//首页面板上部层级左面板
    private JPanel pl_FirstPage_north_right;//首页上部右
    private JLabel lb_ScrollPicture;//滚动图片标签
    private JButton bt_zhengwenhuodong;//征文活动按钮
    private JButton bt_tiegujinhun;//铁骨金魂按钮
    private JButton bt_jingpinmingjiage;//精品名家阁按钮
    private JButton bt_zhengjiuyinhexi;//拯救银河系按钮
    private JButton bt_yijieshoufeipin;//异界收废品按钮
    private JLabel lb_remenbiaoqian;//热门标签
   
    private JPanel pl_FirstPage_center;//首页面板中部
    private JLabel lb_RecommendFengshen;//主编推荐封神榜标题
   
    private JPanel pl_FirstPage_south;//首页面板下部
    private JPanel pl_FirstPage_southRecommend;//首页面板左侧推荐
    private JPanel pl_FirstPage_southFengshen;//首页面板右侧封神榜
   
/*
 * 排行面板    
 */
    private JPanel pl_paihang;//排行面板
   
    private JPanel pl_fengshenbang;//封神榜面板
    
    private JPanel pl_dianjibang;//点击榜面板
 
    private JPanel pl_shoucangbang;//收藏榜面板
    
    private JPanel pl_Smallshoubang;//销售榜面板

    private JPanel pl_gengxinbang;//更新榜面板
    
    private JPanel pl_tuijianbang;//推荐榜面板
/*
 * 书库面板
 */
    private JPanel pl_StackRoom;//书库面板
    
    private JPanel pl_StackRoomleft;//书库左面板
  
    private JPanel pl_StackRoomleftnorth;//书库左面板上
    private JLabel lb_StackRoomPropaganda;//书库宣传标签
   
    
    private JPanel pl_StackRoom_left_center;//书库左中部
    private JLabel lb_fenlei;//分类标签
    
    private JLabel lb_quanbu;//全部标签
    private JLabel lb_huisequanbu;//全部灰色标签
    
    private JLabel lb_xuanhuan;//玄幻标签
    private JLabel lb_huisexuanhuan;//玄幻灰色标签
    
    private JLabel lb_dushi;//都市标签
    private JLabel lb_huisedushi;//都市灰色标签
    
    private JLabel lb_xiuzhen;//修真标签
    private JLabel lb_huisexiuzhen;//修真灰色标签
    
    private JLabel lb_wangyou;//网游标签
    private JLabel lb_huisewangyou;//网游灰色标签
    
    private JLabel lb_kehuan;//科幻标签
    private JLabel lb_huisekehuan;//科幻灰色标签
    
    private JLabel lb_wuxia;//武侠标签
    private JLabel lb_huisewuxia;//武侠灰色标签
    
    private JLabel lb_jingji;//竞技标签
    private JLabel lb_huisejingji;//竞技灰色标签
    
    private JLabel lb_lishi;//历史标签
    private JLabel lb_huiselishi;//历史灰色标签
    
    private JLabel lb_xuanyi;//悬疑标签
    private JLabel lb_huisexuanyi;//悬疑灰色标签
    
    private JLabel lb_tongren;//同人标签
    private JLabel lb_huisetongren;//同人灰色标签
    
    private JLabel lb_tanan;//探案标签
    private JLabel lb_huisetanan;//探案灰色标签

    private JLabel lb_junshi;//军事标签
    private JLabel lb_huisejunshi;//军事灰色标签
    private static int labelcount=0;//判断哪个标签是黑色，开始固定为全部
    private JPanel pl_StackRoom_left_south;//书库分类下
    
    private JPanel pl_StackRoom_right;//书库右面板
    private JPanel pl_StackRoom_right_north;//书库右面板上部
    private JPanel pl_StackRoom_right_center;//书库右面板中
    
	/*
	 * IP专区面板
	 */
	private JPanel pl_IpSpecialArea;// IP专区面板

	/*
	 * 作家福利面板
	 */
	private JPanel pl_WriterWelfare;// 作家福利面板

	/*
	 * 公告资讯面板
	 */
	private JPanel AnnounceIformation;// 公告资讯面板

	/*
	 * 女生专区面板
	 */
	private JPanel GirlSpeicalArea;// 女生专区面板
        
/*
 * 我的书架面板    
 */
    private JPanel pl_MyBookShelf;//我的书架面板(大)
    private JPanel pl_MyBookShelf_north;//我的书库上面板
    private JLabel lb_MyBookShelfUnselect;//我的书架未选按钮
    private JLabel lb_MyBookShelfselect;//我的书架红（已选）
    private JLabel lb_RecentReadingUnselect;//最近阅读未选按钮
    private JLabel lb_RecentReadingselect;//最近阅读红（已选）

    private JPanel pl_MyBookShelf_center;//我的书库中面板
    private JPanel pl_MyBookShelfSmall;//我的书架面板小
    private JPanel pl_RecentReading;//最近阅读面板
    
    private JPanel pl_MyBookShelf_south;//我的书库下面板
   /*
    * 登录面板
    */
    private JPanel pl_login;//登录面板
    private JPanel pl_login_north;//登录上面板
    private JPanel pl_login_north_left;//登录下面板左
    private JLabel lb_login_userlogin;//用户登录文字
    
    private JPanel pl_login_north_right;//登录下面板右
    private JLabel lb_login_userregister;//用户注册文字

    private JPanel pl_login_south;//登录下面板
    private JPanel pl_login_south_left;//登录下面板左部
    private JLabel lb_login_username;//用户名
    private JTextField ta_login_username;//用户名输入框
    private JLabel lb_login_password;//密码
    private JTextField ta_login_password;//密码输入框
    private JLabel lb_login_verificode;//验证码
    private JTextField ta_login_verificode;//验证码输入框
    private JLabel lb_login_verificodepicture;//验证码图片
    private JCheckBox cb_remenberuser;//记住账号单选框
    private JLabel lb_remenberuser;//记住账号文字
    private JLabel lb_login_login;//登录账号按钮
    
    private JPanel pl_login_south_right;//登录下面板右部
    private JLabel lb_login_registertips;//注册账号提示
    private JLabel lb_login_register;//注册账号提示按钮
    /*
     * 注册面板
     */
    private JPanel pl_register;//注册面板
    private JPanel pl_register_north;//注册上面板
    private JPanel pl_register_north_left;//注册上面板左
    private JLabel lb_register_userregister;//用户注册文字
    private JPanel pl_register_north_right;//注册上面板右
    private JLabel lb_register_tips;//已有书海账号文字
    private JLabel lb_register_login;//登录按钮

    private JPanel pl_register_south;//登录下面板
    private JPanel pl_register_south_left;//登录下面板左部
    private JLabel lb_register_phonenumber;//手机号
    private JTextField ta_register_phonenumber;//手机号输入框
    private JLabel lb_register_verificode;//验证码
    private JTextField ta_register_verificode;//验证码输入框
    private JLabel lb_register_verificodeget;//获取验证码文字
    private JLabel lb_register_mailbox;//邮箱
    private JTextField ta_register_mailbox;//邮箱输入框
    private JLabel lb_register_nickname;//昵称
    private JTextField ta_register_nickname;//昵称输入框
    private JLabel lb_register_password;//密码
    private JTextField ta_register_password;//密码输入框
    private JLabel lb_register_confirmpassword;//确认密码
    private JTextField ta_register_confirmpassword;//确认密码输入框
    private JCheckBox cb_AgreeAgreement;//我已阅读并同意协议单选框
    private JLabel lb_AgreeAgreement;//我已阅读并同意协议文字
    private JLabel lb_register_register;//立即注册账号按钮
    
    private JPanel pl_register_south_right;//登录下面板右部
	private static final long serialVersionUID = 1L;
	public Novel() {
		//设置总布局
		JFrame jf=new JFrame("书海小说网");
		jf.setLayout(new BorderLayout());
		jf.setIconImage(Toolkit.getDefaultToolkit().createImage(Novel.class.getResource("主题.jpg")));
		
		// 获取屏幕分辨率
		Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
		int ScreenWidth = dimension.width;
		int ScreenHeight = dimension.height;
		
		//界面总面板
		pl_ALL = new JPanel();
		pl_ALL.setLayout(new BorderLayout());
		pl_ALL.setPreferredSize(new Dimension(ScreenWidth, ScreenHeight));
		
		//滑动总面板
		sp_center=new JScrollPane();
		sp_center.getViewport().add(pl_ALL);
		jf.add(sp_center);
		
		
		//上部总面板
		pl_north=new JPanel();
		pl_north.setLayout(new BorderLayout());
		pl_north.setPreferredSize(new Dimension(0, (int)(ScreenHeight*0.2)));
		pl_north.setBackground(Color.white);
		pl_ALL.add(BorderLayout.NORTH,pl_north);
	    
	    
	    //上部面板上部
	    pl_north_north=new JPanel();
	    pl_north_north.setLayout(null);
	    pl_north_north.setPreferredSize(new Dimension(0,  (int)(ScreenHeight*0.2*0.2)));
	    pl_north_north.setBackground(new Color(189,183,107));
	    pl_north.add(BorderLayout.NORTH,pl_north_north);
	    Font font=new Font("微软雅黑", Font.PLAIN, 12);
	    
	    //书海女神网按钮
	    lb_BookSeaGirlNet=new JLabel("书海女生网");
	    lb_BookSeaGirlNet.setFont(font);
	    lb_BookSeaGirlNet.setForeground(Color.black);
	    lb_BookSeaGirlNet.setBounds( (int)(ScreenWidth*0.125),  (int)(ScreenHeight*0.2*0.2*0),75, 30);
	    pl_north_north.add(lb_BookSeaGirlNet);
	    
	    //书海女神网按钮隔开线
	    lb_BookSeaGirlNetPart=new JLabel("|");
	    lb_BookSeaGirlNetPart.setFont(font);
	    lb_BookSeaGirlNetPart.setForeground(Color.black);
	    lb_BookSeaGirlNetPart.setBounds( (int)(ScreenWidth*0.175),  (int)(ScreenHeight*0.2*0.2*0),75, 30);
	    pl_north_north.add(lb_BookSeaGirlNetPart);
	   
	    //书海文学网按钮
	    lb_BookSeaLiteratureNet=new JLabel("书海文学网");
	    lb_BookSeaLiteratureNet.setFont(font);
	    lb_BookSeaLiteratureNet.setForeground(Color.black);
	    lb_BookSeaLiteratureNet.setBounds( (int)(ScreenWidth*0.185),  (int)(ScreenHeight*0.2*0.2*0),75, 30);
	    pl_north_north.add(lb_BookSeaLiteratureNet);
	    
	    //书海女神网按钮隔开线
	    lb_BookSeaLiteratureNetPart=new JLabel("|");
	    lb_BookSeaLiteratureNetPart.setFont(font);
	    lb_BookSeaLiteratureNetPart.setForeground(Color.black);
	    lb_BookSeaLiteratureNetPart.setBounds( (int)(ScreenWidth*0.235),  (int)(ScreenHeight*0.2*0.2*0),75, 30);
	    pl_north_north.add(lb_BookSeaLiteratureNetPart);
	   
	    //书海动漫网按钮
	    lb_BookSeaComicNet=new JLabel("书海动漫网");
	    lb_BookSeaComicNet.setFont(font);
	    lb_BookSeaComicNet.setForeground(Color.black);
	    lb_BookSeaComicNet.setBounds( (int)(ScreenWidth*0.245),  (int)(ScreenHeight*0.2*0.2*0),75, 30);
	    pl_north_north.add(lb_BookSeaComicNet);
	    
	    
	    //注册按钮
	    lb_register=new JLabel("注册");
	    lb_register.setFont(font);
	    lb_register.setForeground(Color.black);
        lb_register.setBounds( (int)(ScreenWidth*0.72),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
        lb_register.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent e) {
        		if (!(panelcount==4)) {
        			PanelChange(panelcount);
        			panelcount=4;
            		pl_center.add(BorderLayout.CENTER,pl_register);
            		pl_center.repaint();
            		pl_center.updateUI();
				}
        	}
		});
	    pl_north_north.add(lb_register);
	    
	    //注册按钮隔开线
	    lb_registerPart=new JLabel("|");
	    lb_registerPart.setFont(font);
	    lb_registerPart.setForeground(Color.black);
	    lb_registerPart.setBounds( (int)(ScreenWidth*0.745),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
	    pl_north_north.add(lb_registerPart);
	    
	    //登录按钮
	    lb_north_login=new JLabel("登录");
	    lb_north_login.setFont(font);
	    lb_north_login.setForeground(Color.red);
	    //lb_register.setIcon(new ImageIcon(Novel.class.getResource("/com/lxf/Novel/上部统一面板/注册文字.png")));
	    lb_north_login.setBounds((int)(ScreenWidth*0.755),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
	    lb_north_login.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent e) {
        		if (!(panelcount==5)) {
        			PanelChange(panelcount);
        			panelcount=5;
            		pl_center.add(BorderLayout.CENTER,pl_login);
            		pl_center.repaint();
            		pl_center.updateUI();
        		}
        		
        	}
		});
	    pl_north_north.add(lb_north_login);
	    
	    //登录按钮隔开线
	    lb_north_loginPart=new JLabel("|");
	    lb_north_loginPart.setFont(font);
	    lb_north_loginPart.setForeground(Color.black);
	    lb_north_loginPart.setBounds( (int)(ScreenWidth*0.78),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
	    pl_north_north.add(lb_north_loginPart);
	  
	    //帮助按钮
	    lb_help=new JLabel("帮助");
	    lb_help.setFont(font);
	    lb_help.setForeground(Color.black);
	    lb_help.setBounds((int)(ScreenWidth*0.79),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
	    pl_north_north.add(lb_help);
	    
	    //帮助按钮隔开线
	    lb_helpPart=new JLabel("|");
	    lb_helpPart.setFont(font);
	    lb_helpPart.setForeground(Color.black);
	    lb_helpPart.setBounds( (int)(ScreenWidth*0.815),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
	    pl_north_north.add(lb_helpPart);
	    
	    //客户端按钮
	    lb_Client=new JLabel("客户端");
	    lb_Client.setFont(font);
	    lb_Client.setForeground(Color.black);
	    lb_Client.setBounds((int)(ScreenWidth*0.825),  (int)(ScreenHeight*0.2*0.2*0), 50, 30);
	    pl_north_north.add(lb_Client);
		
	    
	    //上部面板中部
	    pl_north_center=new JPanel();
	    pl_north_center.setLayout(null);
	    pl_north_center.setBackground(Color.white);
	    pl_north.add(BorderLayout.CENTER,pl_north_center);
		
	    //上部面板中部书海图片
	    lb_BooksSea=new JLabel();
	    lb_BooksSea.setIcon(new ImageIcon(Novel.class.getResource("书海标题.png")));
	    lb_BooksSea.setBounds( (int)(ScreenWidth*0.105),(int)(ScreenHeight*0.2*0.6*0.2), 150, 60);
	    pl_north_center.add(lb_BooksSea);
	    
	    //上部面板热搜图片
	    lb_HotSearch=new JLabel();
	    lb_HotSearch.setIcon(new ImageIcon(Novel.class.getResource("热搜.png")));
	    lb_HotSearch.setBounds((int)(ScreenWidth*0.375), (int)(ScreenHeight*0.2*0.6*0.2),140, 20);
	    pl_north_center.add(lb_HotSearch);
	    
	    //搜索文本框
	    tf_Search=new JTextField();
	    tf_Search.setFont(font);
	    tf_Search.setBounds((int)(ScreenWidth*0.375), (int)(ScreenHeight*0.2*0.6*0.44),225, 30);
	    pl_north_center.add(tf_Search);
	    
	    //上部面板输入提示图片
	    lb_SearchTips=new JLabel();
	    lb_SearchTips.setIcon(new ImageIcon(Novel.class.getResource("输入提示标签.png")));
	    lb_SearchTips.setBounds((int)(ScreenWidth*0.375), (int)(ScreenHeight*0.2*0.6*0.7),225, 30);
	    pl_north_center.add(lb_SearchTips);
	    
	    //上部面板搜索按钮图片
	    lb_Search=new JLabel();
	    lb_Search.setIcon(new ImageIcon(Novel.class.getResource("搜索按钮.png")));
	    lb_Search.setBounds((int)(ScreenWidth*0.54), (int)(ScreenHeight*0.2*0.6*0.44),225, 30);
	    pl_north_center.add(lb_Search);
	    
	    //上部面板充值按钮
	    lb_Recharge=new JLabel();
	    lb_Recharge.setIcon(new ImageIcon(Novel.class.getResource("充值图片.png")));
	    lb_Recharge.setBounds((int)(ScreenWidth*0.69), (int)(ScreenHeight*0.2*0.6*0.2),225, 30);
	    pl_north_center.add(lb_Recharge);
	    
	    //上部面板作家中心按钮
	    lb_WritersCenter=new JLabel();
	    lb_WritersCenter.setIcon(new ImageIcon(Novel.class.getResource("作家中心图片.png")));
	    lb_WritersCenter.setBounds((int)(ScreenWidth*0.69), (int)(ScreenHeight*0.2*0.6*0.5),225, 30);
	    pl_north_center.add(lb_WritersCenter);
	    
	    //上部面板邮件图像登录按钮
	    lb_center_loginMail=new JLabel();
	    lb_center_loginMail.setIcon(new ImageIcon(Novel.class.getResource("邮箱图片登录图片.png")));
	    lb_center_loginMail.setBounds((int)(ScreenWidth*0.77), (int)(ScreenHeight*0.2*0.6*0.4),225, 30);
	    pl_north_center.add(lb_center_loginMail);
	    
	    //上部面板登录头像图片
	    lb_center_loginHeadPicture=new JLabel();
	    lb_center_loginHeadPicture.setIcon(new ImageIcon(Novel.class.getResource("登录注册按钮.png")));
	    lb_center_loginHeadPicture.setBounds((int)(ScreenWidth*0.81), (int)(ScreenHeight*0.2*0.6*0.3),225, 50);
	    lb_center_loginHeadPicture.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent e) {
        		if (!(panelcount==5)) {
        			PanelChange(panelcount);
        			panelcount=5;
            		pl_center.add(BorderLayout.CENTER,pl_login);
            		pl_center.repaint();
            		pl_center.updateUI();
        		}
        	}
		});
	    pl_north_center.add(lb_center_loginHeadPicture);
	    
	    
	    //上部面板下部
	    pl_north_south=new JPanel();
	    pl_north_south.setLayout(null);
	    pl_north_south.setBackground(new Color(178,34,34));
	    pl_north_south.setPreferredSize(new Dimension(0,  (int)(ScreenHeight*0.2*0.2)));
	    pl_north.add(BorderLayout.SOUTH,pl_north_south);
	    
	    
	    //标题文字格式
	    font=new Font("微软雅黑", Font.PLAIN, 15);
	    //首页按钮
	    lb_FirstPage=new JLabel("首页");
	    lb_FirstPage.setFont(font);
	    lb_FirstPage.setForeground(Color.white);
	    lb_FirstPage.setBounds((int)(ScreenWidth*0.16), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    lb_FirstPage.addMouseListener(new MouseAdapter() {
	    	@Override
	    	public void mouseClicked(MouseEvent e) {
	    		if (!(panelcount==0)) {
	    			PanelChange(panelcount);
	    			panelcount=0;
		    		pl_center.add(BorderLayout.CENTER,pl_FirstPage);
		    		pl_center.repaint();
	        		pl_center.updateUI();
				}
	    	}
		});
	    pl_north_south.add(lb_FirstPage);
	    
	    //首页隔开按钮
	    lb_FirstPagePart=new JLabel("|");
	    lb_FirstPagePart.setFont(font);
	    lb_FirstPagePart.setForeground(Color.white);
	    lb_FirstPagePart.setBounds((int)(ScreenWidth*0.21), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_FirstPagePart);
	    
	    //书库按钮
	    lb_StackRoom=new JLabel("书库");
	    lb_StackRoom.setFont(font);
	    lb_StackRoom.setForeground(Color.white);
	    lb_StackRoom.setBounds((int)(ScreenWidth*0.24), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    lb_StackRoom.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent e) {
        		if (!(panelcount==1)) {
        			PanelChange(panelcount);
        			panelcount=1;
            		pl_center.add(BorderLayout.CENTER,pl_StackRoom);
            		pl_center.repaint();
            		pl_center.updateUI();
        		}
        		
        	}
		});
	    pl_north_south.add(lb_StackRoom);
	    
	    //书库隔开标签
	    lb_StackRoomPart=new JLabel("|");
	    lb_StackRoomPart.setFont(font);
	    lb_StackRoomPart.setForeground(Color.white);
	    lb_StackRoomPart.setBounds((int)(ScreenWidth*0.29), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_StackRoomPart);
	    
	    //排行按钮
	    lb_Ranking=new JLabel("排行");
	    lb_Ranking.setFont(font);
	    lb_Ranking.setForeground(Color.white);
	    lb_Ranking.setBounds((int)(ScreenWidth*0.325), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    lb_Ranking.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent e) {
        		if (!(panelcount==2)) {
        			PanelChange(panelcount);
        			panelcount=2;
            		pl_center.add(BorderLayout.CENTER,pl_paihang);
            		pl_center.repaint();
            		pl_center.updateUI();
        		}
        	}
		});
	    pl_north_south.add(lb_Ranking);
	    
	    //排行隔开标签
	    lb_RankingPart=new JLabel("|");
	    lb_RankingPart.setFont(font);
	    lb_RankingPart.setForeground(Color.white);
	    lb_RankingPart.setBounds((int)(ScreenWidth*0.37), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_RankingPart);
	    
	    //IP专区按钮
	    lb_IpSpecialArea=new JLabel("IP专区");
	    lb_IpSpecialArea.setFont(font);
	    lb_IpSpecialArea.setForeground(Color.white);
	    lb_IpSpecialArea.setBounds((int)(ScreenWidth*0.4), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_IpSpecialArea);
	    
	    //IP专区按钮隔开线
	    lb_IpSpecialAreaPart=new JLabel("|");
	    lb_IpSpecialAreaPart.setFont(font);
	    lb_IpSpecialAreaPart.setForeground(Color.white);
	    lb_IpSpecialAreaPart.setBounds((int)(ScreenWidth*0.455), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_IpSpecialAreaPart);
	    
	    //作家福利按钮
	    lb_WriterWelfare=new JLabel("作家福利");
	    lb_WriterWelfare.setFont(font);
	    lb_WriterWelfare.setForeground(Color.white);
	    lb_WriterWelfare.setBounds((int)(ScreenWidth*0.485), (int)(ScreenHeight*0.2*0.2*0.05), 100, 30);
	    pl_north_south.add(lb_WriterWelfare);
	    
	    //作家福利按钮隔开线
	    lb_WriterWelfarePart=new JLabel("|");
	    lb_WriterWelfarePart.setFont(font);
	    lb_WriterWelfarePart.setForeground(Color.white);
	    lb_WriterWelfarePart.setBounds((int)(ScreenWidth*0.55), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_WriterWelfarePart);
	    
	    //公告资讯按钮
	    lb_AnnounceInformation=new JLabel("公告资讯");
	    lb_AnnounceInformation.setFont(font);
	    lb_AnnounceInformation.setForeground(Color.white);
	    lb_AnnounceInformation.setBounds((int)(ScreenWidth*0.58), (int)(ScreenHeight*0.2*0.2*0.05), 100, 30);
	    pl_north_south.add(lb_AnnounceInformation);
	    
	    //公告资讯按钮隔开线
	    lb_AnnounceInformationPart=new JLabel("|");
	    lb_AnnounceInformationPart.setFont(font);
	    lb_AnnounceInformationPart.setForeground(Color.white);
	    lb_AnnounceInformationPart.setBounds((int)(ScreenWidth*0.645), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_AnnounceInformationPart);
	    
	    //女生专区按钮
	    lb_GirlSpecialArea=new JLabel("女生专区");
	    lb_GirlSpecialArea.setFont(font);
	    lb_GirlSpecialArea.setForeground(Color.white);
	    lb_GirlSpecialArea.setBounds((int)(ScreenWidth*0.675), (int)(ScreenHeight*0.2*0.2*0.05), 100, 30);
	    pl_north_south.add(lb_GirlSpecialArea);
	    
	    //女生专区按钮隔开线
	    lb_GirlSpecialAreaPart=new JLabel("|");
	    lb_GirlSpecialAreaPart.setFont(font);
	    lb_GirlSpecialAreaPart.setForeground(Color.white);
	    lb_GirlSpecialAreaPart.setBounds((int)(ScreenWidth*0.74), (int)(ScreenHeight*0.2*0.2*0.05), 50, 30);
	    pl_north_south.add(lb_GirlSpecialAreaPart);
	    
	    
	    //我的书架按钮
	    lb_MyBookShelf=new JLabel("我的书架");
	    lb_MyBookShelf.setFont(font);
	    lb_MyBookShelf.setForeground(Color.white);
	    lb_MyBookShelf.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent e) {
        		if (!(panelcount==3)) {
        			PanelChange(panelcount);
        			panelcount=3;
            		pl_center.add(BorderLayout.CENTER,pl_MyBookShelf);
            		pl_center.repaint();
            		pl_center.updateUI();
        		}
        		
        	}
		});
	    lb_MyBookShelf.setBounds((int)(ScreenWidth*0.77), (int)(ScreenHeight*0.2*0.2*0.05), 100, 30);
	    pl_north_south.add(lb_MyBookShelf);
/*======================================中部切换面板========================================*/
	    //中部面板
  		pl_center=new JPanel();
  		pl_center.setLayout(new BorderLayout());
  		pl_center.setBackground(Color.white);
  		pl_ALL.add(BorderLayout.CENTER,pl_center);
	    
	    //中部切换面板左面板
	    pl_centerleft=new JPanel();
	    pl_centerleft.setBackground(Color.white);
	    pl_centerleft.setPreferredSize(new Dimension((int)(ScreenWidth*0.125), 0));
	    pl_center.add(BorderLayout.WEST,pl_centerleft);
	    
	    //中部切换面板右面板
	    pl_centerright=new JPanel();
	    pl_centerright.setBackground(Color.white);
	    pl_centerright.setPreferredSize(new Dimension((int)(ScreenWidth*0.15), 0));
	    pl_center.add(BorderLayout.EAST,pl_centerright);
/*
 * 中部切换面板中面板:首页、书库、排行、IP专区、作家福利、公告资讯、女生专区、我的书架
 */
	    
	    
/*=============================================================================*/
        jf.setSize(ScreenWidth,ScreenHeight);//设置大小
		jf.setVisible(true);//设置可见
		jf.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);//设置可关闭
		jf.setLocationRelativeTo(null);//居中
	} 
	public void PanelChange(int panelcount) {
		switch (panelcount) {
		case 0:
             pl_center.remove(pl_FirstPage);
			break;
		case 1:
			pl_center.remove(pl_StackRoom);
			break;
		case 2:
			pl_center.remove(pl_paihang);
			break;
		case 3:
			pl_center.remove(pl_MyBookShelf);
			break;
		case 4:
			pl_center.remove(pl_register);
			break;
		case 5:
			pl_center.remove(pl_login);
			break;
		default:
			break;
		}
	}
	public static void main(String[] args) {
		new Novel();
	}

}
